﻿// owner 蒋家伟

#pragma once

// 序列化
#include "DBSchemaObject.h"
#include "ObjectReflectDeclare.h"
#include "DataSerializeDefine.h"

// 组件
#include "ElementBasicInfomation.h"

namespace jsdk
{
    class DATASCHEMA_EXPORT ElementBaseCompoent : public DBSchemaObject
    {
        OBJECT_SERIALIZE_DECLARE_DERIVED1(jsdk, ElementBaseCompoent, L"{505D87E1-1B5A-40D3-AB49-560C76756370}", DBSchemaObject)
            DATA_CUSTOM(IDocument*, pOwnerDoc)
            DATA(OwnerPtr<ElementBasicInfomation>, opBasicInfomation)
    public:
        static OwnerPtr<ElementBaseCompoent> create();
        void setComponentOwnerElement(IElement* pElement);

#pragma region ElementBasicInfomation
        void setDocument(IDocument* pDoc);
        const IDocument* getDocument() const;
        IDocument* getDocument();
        void setElementId(const ElementId& elementId);
        ElementId getElementId() const;
        void setTypeUid(const UniqueId& typeUid);
        void setIsTemporary(bool isTemp);
        const IElementBasicInfomation* getBasicInfomation() const;
        IElementBasicInfomation* getBasicInfomation();

    private:
        const ElementBasicInfomation* getBasicInfomationImp() const;
        ElementBasicInfomation* getBasicInfomationImp();
#pragma region ElementBasicInfomation
    };
}
